﻿using Dotnet6WebApiDemo.Services;

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Dotnet6WebApiDemo.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class InheritController : ControllerBase
    {
        public IChildService ChildService { get; set; } = null!;
        //public IParentService ParentService { get; set; } = null!;

        [HttpGet]
        public Dictionary<string, string> Get()
        {
            Dictionary<string, string> datas = new Dictionary<string, string>
            {
                [nameof(ChildService.SingletonService)] = ChildService.SingletonService.ToString()!,
                [nameof(ChildService.ScopedService)] = ChildService.ScopedService.ToString()!,
            };

            return datas;
        }
    }
}
